﻿using System;
using BarberShop.Data;
using System.Collections.Generic;
namespace BarberShop.Model
{
	/// <summary>
	/// StoresInfo:实体类(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public partial class StoresInfoModel
	{
		public StoresInfoModel()
		{}
		#region Model
		private int _id;
		private string _storename;
		private int? _brand_id=0;
		private int? _province_id=0;
		private int? _city_id=0;
		private string _address="";
		private string _telname="";
		private string _telphone="";
		private DateTime? _contactbegindate= DateTime.Now;
		private int? _contactdeadline=0;
		private int? _devicenum=0;
		private DateTime? _modifydate;
		private DateTime? _createdate= DateTime.Now;
        private int? _verupdatestatus = 0;
        private DateTime? _vercreatedate = DateTime.Now;
        private DateTime? _verupdatedate = DateTime.Now;

		/// <summary>
		/// 
		/// </summary>
		public int ID
		{
			set{ _id=value;}
			get{return _id;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string StoreName
		{
			set{ _storename=value;}
			get{return _storename;}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? Brand_ID
		{
			set{ _brand_id=value;}
			get{return _brand_id;}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? Province_ID
		{
			set{ _province_id=value;}
			get{return _province_id;}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? City_ID
		{
			set{ _city_id=value;}
			get{return _city_id;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Address
		{
			set{ _address=value;}
			get{return _address;}
		}
		/// <summary>
		/// 联系人
		/// </summary>
		public string TelName
		{
			set{ _telname=value;}
			get{return _telname;}
		}
		/// <summary>
		/// 联系电话
		/// </summary>
		public string TelPhone
		{
			set{ _telphone=value;}
			get{return _telphone;}
		}
		/// <summary>
		/// 合同开始日期
		/// </summary>
		public DateTime? ContactBeginDate
		{
			set{ _contactbegindate=value;}
			get{return _contactbegindate;}
		}
		/// <summary>
		/// 合同期限
		/// </summary>
		public int? ContactDeadline
		{
			set{ _contactdeadline=value;}
			get{return _contactdeadline;}
		}
		/// <summary>
		/// 终端数量
		/// </summary>
		public int? DeviceNum
		{
			set{ _devicenum=value;}
			get{return _devicenum;}
		}
		/// <summary>
		/// 
		/// </summary>
		public DateTime? ModifyDate
		{
			set{ _modifydate=value;}
			get{return _modifydate;}
		}
		/// <summary>
		/// 
		/// </summary>
		public DateTime? CreateDate
		{
			set{ _createdate=value;}
			get{return _createdate;}
		}
        public int? VerUpdateStatus
        {
            set { _verupdatestatus =value; }
            get { return _verupdatestatus; }
        }
        public DateTime? VerUpdateDate
        {
            set { _verupdatedate = value; }
            get { return _verupdatedate; }
        }
        public DateTime? VerCreateDate
        {
            set { _vercreatedate = value; }
            get { return _vercreatedate; }
        }
		#endregion Model


        public static StoresInfoModel ConvertDataModel(StoresInfo info)
        {
            StoresInfoModel r = new StoresInfoModel();
            r.CreateDate = info.CreateDate;
            r.ID = info.ID;
            r.Address = info.Address;
            r.Brand_ID = info.Brand_ID;
            r.City_ID = info.City_ID;
            r.ContactBeginDate = info.ContactBeginDate;
            r.ContactDeadline = info.ContactDeadline;
            r.CreateDate = info.CreateDate;
            r.DeviceNum = info.DeviceNum;
            r.ID = info.ID;
            r.ModifyDate = info.ModifyDate;
            r.Province_ID = info.Province_ID;
            r.StoreName = info.StoreName;
            r.TelName = info.TelName;
            r.TelPhone = info.TelPhone;
            r.VerCreateDate = info.VerCreateDate;
            r.VerUpdateDate = info.VerUpdateDate;
            r.VerUpdateStatus = info.VerUpdateStatus;
            return r;
        }

        public static IList<StoresInfoModel> ConvertDataModelConllection(IList<StoresInfo> infoList)
        {
            IList<StoresInfoModel> rList = new List<StoresInfoModel>();
            foreach (var info in infoList)
            {
                StoresInfoModel r = new StoresInfoModel();
                r.CreateDate = info.CreateDate;
                r.ID = info.ID;
                r.Address = info.Address;
                r.Brand_ID = info.Brand_ID;
                r.City_ID = info.City_ID;
                r.ContactBeginDate = info.ContactBeginDate;
                r.ContactDeadline = info.ContactDeadline;
                r.CreateDate = info.CreateDate;
                r.DeviceNum = info.DeviceNum;
                r.ID = info.ID;
                r.ModifyDate = info.ModifyDate;
                r.Province_ID = info.Province_ID;
                r.StoreName = info.StoreName;
                r.TelName = info.TelName;
                r.TelPhone = info.TelPhone;
                r.VerCreateDate = info.VerCreateDate;
                r.VerUpdateDate = info.VerUpdateDate;
                r.VerUpdateStatus = info.VerUpdateStatus;
                rList.Add(r);
            }
            return rList;
        }
	}
}

